package org.ccsoft.mc.core.impl;

import java.util.List;
import java.util.Set;

import org.ccsoft.mc.core.ServiceChangeListener;
import org.ccsoft.mc.core.ServiceContext;
import org.ccsoft.mc.core.ServiceBundle;
public class ServiceContextImpl implements ServiceContext{
	protected BaseCache readyServiceCache;
	protected BaseCache unresolvingServiceCache;
	public ServiceContextImpl(BaseCache readyServiceCache,BaseCache unresolvingServiceCache){
		this.readyServiceCache=readyServiceCache;
		this.unresolvingServiceCache=unresolvingServiceCache;
	}
	public Object getServiceByName(String name) {
		return readyServiceCache.getServiceByName(name);	
	}

	public Object getServiceByType(String type) {
		return readyServiceCache.getServiceByType(type);
	}

	public Object getServiceByType(String type, String name) {		
		return readyServiceCache.getServiceByType(type,name);
	}

	public List getServicesByType(String type) {		
		return readyServiceCache.getServicesByType(type);
	}

	public void registerServiceChangeListener(ServiceChangeListener listener) {
		readyServiceCache.registerServiceChangeListener(listener);		
	}	
	public Set<ServiceBundle> getUnResolvingServiceBundles() {
		return unresolvingServiceCache.getServiceBundles();
	}
	public Set<ServiceBundle> getReadyServiceBundles() {
		
		return readyServiceCache.getServiceBundles();
	}
	public BaseCache getUnResolvingServiceCache() {
		
		return unresolvingServiceCache;
	}
	public BaseCache getReadyServiceCache() {
		
		return readyServiceCache;
	}
	public void removeReadyServiceBundle(String name) {
		readyServiceCache.removeBundleByName(name);
		
	}
	

}
